<?php

class Add_Publish_Article_Delete
{
    protected $_articleId;
    
    public function __construct($articleId)
    {
        $this->_articleId = $articleId;
    }
    
    public function delete()
    {

        $article = App_Model_DbTable_Article::getInstance()->getRowById($this->_articleId);
        if(!$article){
            return "";
        }
        
        $row = array(
            'status'    => 0,
        );                
        App_Model_DbTable_Article::getInstance()->addOld($row, $this->_articleId);
        
        App_Model_DbTable_Article_Search_Threads::getInstance()->del($this->_articleId);

        if($article['replyArticleId']){
            App_Model_DbTable_Reply::getInstance()->del($this->_articleId);
        }else{
            App_Model_DbTable_Article_Search_Tags::getInstance()->deleteByArticleId($this->_articleId);
        }
        
        
    }
}
